import request from '@/utils/request'

// 查询公示公告列表
export function listLpPublicBulletin(query) {
  return request({
    url: '/LpPublicBulletin/lpPublicBulletin/list',
    method: 'get',
    params: query
  })
}

// 公示公告
export function findListReviewed(query) {
  return request({
    url: '/LpPublicBulletin/lpPublicBulletin/findListReviewed',
    method: 'get',
    params: query
  })
}

// 邮件复核
export function findListNotReviewed(query) {
  return request({
    url: '/LpPublicBulletin/lpPublicBulletin/findListNotReviewed',
    method: 'get',
    params: query
  })
}

// 查询公示公告详细
export function getLpPublicBulletin(id) {
  return request({
    url: '/LpPublicBulletin/lpPublicBulletin/' + id,
    method: 'get'
  })
}

// 保存公示公告
export function saveLpPublicBulletin(data) {
  return request({
    url: '/LpPublicBulletin/lpPublicBulletin/save',
    method: 'post',
    data: data
  })
}

// 删除公示公告
export function delLpPublicBulletin(id) {
  return request({
    url: '/LpPublicBulletin/lpPublicBulletin/' + id,
    method: 'delete'
  })
}

// 修改复核状态
export function updateReviewStatus(id, delFlag) {
  return request({
    url: '/LpPublicBulletin/lpPublicBulletin/updateReviewStatus/' + id + '/' + delFlag,
    method: 'get'
  })
}

export function viewInvestorInfo(data) {
  return request({
    url: '/LpPublicBulletin/lpPublicBulletin/viewInvestorInfo',
    method: 'post',
    data: data
  })
}

// 发送复核公告/ 基金分配及基金Call款中使用. 会自动修改主表的ACT_STATUS
export function sendReviewAnnouncement(id) {
  return request({
    url: '/LpPublicBulletin/lpPublicBulletin/sendReviewAnnouncement/' + id,
    method: 'get'
  })
}

// 出资人邮箱发送/重新发送错误修正
export function resendReviewAnnouncement(data) {
  return request({
    url: '/LpPublicBulletin/lpPublicBulletin/resendReviewAnnouncement',
    method: 'post',
    data: data
  })
}

// 修改可显示状态
export function modifyShowStatus(id, status) {
  return request({
    url: '/LpPublicBulletin/lpPublicBulletin/modifyShowStatus/' + id + '/' + status,
    method: 'get'
  })
}
